unzip miui_HAYDN_*.zip payload.bin
unzip miui_ALIOTH_*.zip payload.bin
python scripts/update-payload-extractor/extract.py payload.bin --output_dir ./payload_output
sudo fastboot flash abl_ab payload_output/abl.img
sudo fastboot flash aop_ab payload_output/aop.img
sudo fastboot flash bluetooth_ab payload_output/bluetooth.img
sudo fastboot flash boot_ab payload_output/boot.img
sudo fastboot flash cpucp_ab payload_output/cpucp.img
sudo fastboot flash devcfg_ab payload_output/devcfg.img
sudo fastboot flash dsp_ab payload_output/dsp.img
sudo fastboot flash dtbo_ab payload_output/dtbo.img
sudo fastboot flash featenabler_ab payload_output/featenabler.img
sudo fastboot flash hyp_ab payload_output/hyp.img
sudo fastboot flash imagefv_ab payload_output/imagefv.img
sudo fastboot flash keymaster_ab payload_output/keymaster.img
sudo fastboot flash modem_ab payload_output/modem.img
sudo fastboot flash qupfw_ab payload_output/qupfw.img
sudo fastboot flash shrm_ab payload_output/shrm.img
sudo fastboot flash tz_ab payload_output/tz.img
sudo fastboot flash uefisecapp_ab payload_output/uefisecapp.img
sudo fastboot flash vbmeta_system_ab payload_output/vbmeta_system.img
sudo fastboot flash vbmeta_ab payload_output/vbmeta.img
sudo fastboot flash vendor_boot_ab payload_output/vendor_boot.img
sudo fastboot flash xbl_config_ab payload_output/xbl_config.img
sudo fastboot flash xbl_ab payload_output/xbl.img
sudo fastboot flash cmnlib_ab payload_output/cmnlib.img
sudo fastboot flash cmnlib64_ab payload_output/cmnlib64.img
sudo fastboot reboot fastboot
sudo fastboot flash odm_a payload_output/odm.img
sudo fastboot flash product_a payload_output/product.img
sudo fastboot flash system_ext_a payload_output/system_ext.img
sudo fastboot flash system_a payload_output/system.img
sudo fastboot flash vendor_a payload_output/vendor.img
sudo fastboot set_active a
sudo fastboot reboot
rm -rf payload_input/* payload_output/*
